//
//  BookDataBaseDAL.m
//  readNovels
//
//  Created by 吳瀾洲 on 2020/4/27.
//  Copyright © 2020 wulanzhou. All rights reserved.
//

#import "BookDataBaseDAL.h"
#import "BookDBManager.h"
#import "BDatabaseSQL.h"

@implementation BookDataBaseDAL

//创建数据库
+ (void)createDB{
    NSArray *sqlList = [NSArray arrayWithObjects:book_table_sql,catalog_table_sql,chapter_table_sql,nil];
    [self createDBWithName:database_name createTableArray:sqlList];
}

//创建数据库
+ (void)createDBWithName:(NSString *)dbName{
    NSArray *sqlList = [NSArray arrayWithObjects:book_table_sql,catalog_table_sql,chapter_table_sql,nil];
    [self createDBWithName:dbName createTableArray:sqlList];
}

//创建数据库
+ (void)createDBWithName:(NSString *)dbName createTableArray:(NSArray *)sql{
    [[BookDBManager shareInstance] createDBWithName:dbName tableSqlArray:sql];
}

@end
